import 'package:flutter/material.dart';

class AuthState extends ChangeNotifier {
  String? _userPhone;
  String? _token;
  Map<String, dynamic>? _user;

  String? get userPhone => _userPhone;
  String? get token => _token;
  Map<String, dynamic>? get user => _user;

  bool get isLoggedIn => _userPhone != null && _token != null;

  void login(String phone, String token, Map<String, dynamic> user) {
    _userPhone = phone;
    _token = token;
    _user = user;
    notifyListeners();
  }

  void logout() {
    _userPhone = null;
    _token = null;
    _user = null;
    notifyListeners();
  }
}
